package com.example.xksys.controller;

import com.example.xksys.service.CourseService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/course")
public class CourseController {
    @Resource
    private CourseService courseService;
    @RequestMapping("/search")
    public List<Map<String,Object> >search(@RequestParam Map<String,String> param){
        System.out.println(courseService.dosearch(param));
        return courseService.dosearch(param);
    }
    @RequestMapping("/add_one")
    public int add_one(@RequestParam Map<String,String>param){
        return courseService.doadd_one(param);
    }
    @RequestMapping("/delete_one")
    public int delete_one(@RequestParam Map<String,String>param){
        return courseService.dodelete_one(param);
    }

    @RequestMapping("/have")
    public List<Map<String,Object> >have(@RequestParam Map<String,String> param){
        return courseService.dohave(param);
    }
}
